﻿
using Devbridge.IPolice.DomainModel;
using FluentNHibernate.Mapping;

namespace Devbridge.IPolice.Repositories.Mappings
{
    public class PoliceOfficerMap : ClassMap<PoliceOfficer>
    {
        public PoliceOfficerMap()
        {
            Table("PoliceOfficer");

            Id(f => f.Id).GeneratedBy.Identity();

            Map(f => f.FirstName);
            Map(f => f.LastName);
            Map(f => f.PhoneNumber);

            HasMany(f => f.Crimes).KeyColumn("PoliceOfficerId").LazyLoad();
        }
    }
}
